<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />

    <meta
      http-equiv="Cache-Control"
      content="no-cache, no-store, must-revalidate"
    />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />

    <link rel="stylesheet" href="./assets/css/index.css" />
    <title>智能风控数据系统</title>
  </head>
  <body>
    <noscript>
      <strong
        >要正常访问 <em>智能风控数据系统</em> 必须启用 JavaScript。</strong
      >
    </noscript>

    <div id="app">
      <div class="head">智能风控数据系统</div>

      <div class="time-body">
        <div class="time-item">
          <div class="time-label">纽约时间</div>
          <div class="time-label" id="newYork">纽约时间</div>
        </div>
        <div class="time-item">
          <div class="time-label">北京时间</div>
          <div class="time-label" id="beijing">纽约时间</div>
        </div>
        <div class="time-item">
          <div class="time-label">伦敦时间</div>
          <div class="time-label" id="london">纽约时间</div>
        </div>
      </div>

      <div class="modules-body">
        <div class="modules">
          <div class="modules-head">
            <span class="tab-name"></span>
          </div>
          <div class="modules-body2">
            <div class="modules-table-head">
              <div>公司</div>
              <div>批额</div>
              <div>放款</div>
              <div>周期</div>
              <div>评分</div>
              <div>已还期数</div>
            </div>
            <div class="DailyDataScreenBox">
              <ul class="content-ul scrollBox"></ul>
            </div>
          </div>
        </div>
        <div class="modules">
            <div class="modules-head">
              <span class="tab-name"></span>
            </div>
            <div class="modules-body2">
              <div class="modules-table-head">
                <div>公司</div>
                <div>批额</div>
                <div>放款</div>
                <div>周期</div>
                <div>评分</div>
                <div>已还期数</div>
              </div>
              <div class="DailyDataScreenBox">
                <ul class="content-ul scrollBox"></ul>
              </div>
            </div>
          </div>
          <div class="modules">
            <div class="modules-head">
              <span class="tab-name"></span>
            </div>
            <div class="modules-body2">
              <div class="modules-table-head">
                <div>公司</div>
                <div>批额</div>
                <div>放款</div>
                <div>周期</div>
                <div>评分</div>
                <div>已还期数</div>
              </div>
              <div class="DailyDataScreenBox">
                <ul class="content-ul scrollBox"></ul>
              </div>
            </div>
          </div>
          <div class="modules">
            <div class="modules-head">
              <span class="tab-name"></span>
            </div>
            <div class="modules-body2">
              <div class="modules-table-head">
                <div>公司</div>
                <div>批额</div>
                <div>放款</div>
                <div>周期</div>
                <div>评分</div>
                <div>已还期数</div>
              </div>
              <div class="DailyDataScreenBox">
                <ul class="content-ul scrollBox"></ul>
              </div>
            </div>
          </div>
      </div>
    </div>
    <!-- built files will be auto injected -->
  </body>
  <script type="text/javascript" src="./assets/js/time.js"></script>
  <script type="text/javascript" src="./assets/js/jquery-3.7.1.min.js"></script>
  
  <script>
    $(function () {
    });
    //有名函数
    function fn() {
      var beijing = timeBox.getWorldTime().beijing;
      document.getElementById("beijing").innerHTML =
        beijing.year +
        "-" +
        beijing.mouth +
        "-" +
        beijing.date +
        " " +
        beijing.hour +
        ":" +
        beijing.min +
        ":" +
        beijing.sec;

      var newYork = timeBox.getWorldTime().newYork;
      document.getElementById("newYork").innerHTML =
        newYork.year +
        "-" +
        newYork.mouth +
        "-" +
        newYork.date +
        " " +
        newYork.hour +
        ":" +
        newYork.min +
        ":" +
        newYork.sec;

      var london = timeBox.getWorldTime().london;
      document.getElementById("london").innerHTML =
        london.year +
        "-" +
        london.mouth +
        "-" +
        london.date +
        " " +
        london.hour +
        ":" +
        london.min +
        ":" +
        london.sec;
    }
    //执行
    fn();
    //多次执行的定时器
    setInterval(fn, 1000);

    function train(res){
         console.log(res)
         res.forEach((el, index) => {
            var dom = document.getElementsByClassName("scrollBox");
            var tabName = document.getElementsByClassName("tab-name");
            if(dom[index]){
                var html = '';
                el.dataPos.forEach( e => {
                    html += `<li>
                        <div>${e.customerName}</div>
                        <div>${e.batchAmount}</div>
                        <div>${e.loanAmount}</div>
                        <div>${e.cycle}</div>
                        <div>${e.score}</div>
                        <div>${e.repaidPeriod}</div>
                    </li>`
                })
                dom[index].innerHTML = html;
                dom[index].style = `animation-duration: ${el.dataPos.length * 3}s;`
                tabName[index].innerHTML = el.dataTypeName;
            }
         });
     }
  </script>
  <script src="./data.json?callback=train"></script>
</html>
